@using BlazorApp.Pages.Common.Metadata
@using Extension.k8s
@using k8s.Models
@inherits BlazorApp.Pages.Common.PageBase

<Divider Orientation="left" Style="font-weight:bold">@L["Pod"]</Divider>
@if (Pods is { Count: > 0 })
{
    <Table TItem="V1Pod" DataSource="@Pods"
           HidePagination="true" PageSize="5000"
           Size=@TableSize.Small Bordered="true">
        <AntDesign.Column Title=@L["Name"] TData="string" Width="200px">
            <a onclick="@(() => OnPodNameClick(context))">@context.Name()</a>
        </AntDesign.Column>
        <AntDesign.Column Sortable="true" TData="string" Title=@L["Namespace"] Field="@context.Namespace()"/>
        <AntDesign.Column Sortable="true" TData="string" Title=@L["Ready"]>@context.ReadySummary()</AntDesign.Column>
        <AntDesign.Column Sortable="true" TData="string" Title=@L["IP"]
                          Width="100px">
            @context.Status.PodIP
        </AntDesign.Column>
        <AntDesign.Column Title=@L["Restart"] TData="string">
            @context.RestartCount()
        </AntDesign.Column>
        <AntDesign.Column Sortable="true" TData="string" Title=@L["Status"]>
            <StatusView Status=@context.Status()></StatusView>
        </AntDesign.Column>
    </Table>
}
@if (Pods == null || Pods.Count == 0)
{
    <Empty Simple/>
}
